//
//  HomeGourmetCell.m
//  OrderSeat
//
//  Created by haiming on 13-10-15.
//  Copyright (c) 2013年 wangwei. All rights reserved.
//

#import "HomeGourmetCell.h"
#import "UIImageView+WebCache.h"


#define kIMAGE      1001
#define kDISHNAME   1002
#define kCONTENT    1003
#define kRNAME      1004
@implementation HomeGourmetCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)setContent:(NSDictionary *)dic
{
    NSString *image = [dic objectForKey:@"image"];
    NSString *title = [dic objectForKey:@"title"];
    NSString *rName = [dic objectForKey:@"dname"];
    NSString *content = [dic objectForKey:@"content"];
    
    if ([content length] > 45) {
        content = [[content substringToIndex:45] stringByAppendingString:@"..."];
    }
    
    NSURL *url = [NSURL URLWithString:image];
    [_logoImage setImageWithURL:url];
    
    _titleLabel.text = title;
    _contentLabel.text = content;
    _shopNameLabel.text = rName;
    
    [_contentLabel autoHeightForMutiLines];
    
    [self reLayoutSubviews];
}

- (void)reLayoutSubviews
{
    [_view drawBorder];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
}

@end
